package cn.com.thingo.hyintelligent.ui.adapter;

import android.content.Context;

import com.baoyz.swipemenulistview.SwipeMenu;
import com.baoyz.swipemenulistview.SwipeMenuCreator;
import com.baoyz.swipemenulistview.SwipeMenuItem;

import cn.com.thingo.hyintelligent.R;
import cn.com.thingo.hyintelligent.util.SystemUtil;

public class DeleteSwipeMenuCreator implements SwipeMenuCreator {
    private Context context;

    public DeleteSwipeMenuCreator(Context context) {
        this.context = context;
    }

    @Override
    public void create(SwipeMenu menu) {
        SwipeMenuItem deleteItem = new SwipeMenuItem(context);
        deleteItem.setBackground(R.drawable.swipe_delete_bg);
        deleteItem.setWidth(SystemUtil.dp2px(60));
        deleteItem.setIcon(R.mipmap.sys_mdelete);
        menu.addMenuItem(deleteItem);
    }
}
